package cn.edu.cqu.bysj.wm.gui.component;

import java.awt.BorderLayout;

import cn.edu.cqu.bysj.wm.gui.model.AlgorithmConfig;
import cn.edu.cqu.bysj.wm.gui.result.LPAlgorithmResult;
import cn.edu.cqu.bysj.wm.gui.table.CommunityView;

public class LPSQAlgorithmTabPane extends AlgorithmTabPane {

	LPSQAlgorithmResultContent content = new LPSQAlgorithmResultContent();

	/**
	 * create lp algorithm tab
	 */
	public LPSQAlgorithmTabPane(String _title, AlgorithmConfig _configure) {
		super(1, _title, _configure);
		setLayout(new BorderLayout(0, 0));

		splitPane.setLeftComponent(content);
		splitPane.setDividerSize(0);
		add(splitPane);
	}

	public void showResult() {
		// community detection result
		CommunityView cView1 = new CommunityView("社区发现结果一览", 20);
		cView1.initDatas(result.getCommunityRows());
		content.getCommunityResult().add(cView1, BorderLayout.CENTER);
		LPAlgorithmResult temp = (LPAlgorithmResult) result;
		content.getTotalTime().setText(temp.getTotalTime() + "");
		content.getInitialTime().setText(temp.getInitTime() + "");
		content.getIterationTime().setText(temp.getIterTime() + "");
		content.getQValue().setText(temp.getQ() + "");

	}
}
